package com.wsx.sky.gateway.outter.http.service;

import com.wsx.sky.http.bean.HttpRequest;
import com.wsx.sky.http.bean.HttpResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author wangshuaixin
 * @Title: com.wsx.sky.gateway.outter.http.service.HttpFeignService
 * @Description: TODO
 * @date 2018/12/10
 */
@FeignClient(name = "gateway-client", url = "http://localhost:8131/http/client")
public interface HttpFeignService {


    @RequestMapping(
            value = "/get/feign/{name}",
            method = {RequestMethod.GET}
    )
    HttpResponse get(@PathVariable("name") String name);


    @RequestMapping(
            value = "/request/feign",
            method = {RequestMethod.POST}
    )
    HttpResponse post(@RequestBody HttpRequest httpRequest);


    @RequestMapping(
            value = "/redis/{key}",
            method = {RequestMethod.GET}
    )
    HttpResponse redis(@PathVariable("key") String key);
}
